package com.mj.entity;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

@Repository(value = "mylog") @Aspect
public class Log {
   /* public void open(){
        System.out.println("数据库打开并连接");
    }*/
    /*public void close(){
        System.out.println("数据库断开连接");
    }*/
    @Before("execution(public * com.mj.entity..User.s*(..))")
    public void connect(){
        System.out.println("连接数据库");
    }

    @After("execution(public * com.mj.entity..*.*(..))")
    //@After("execution(public * *(..))")
    public void close(){
        System.out.println("关闭连接数据库........");
    }
}
